Optimal. Leaf size=121 \[ -\frac {\left (a c e+b^2 (-e)+b c d\right ) \log \left (a+b x+c x^2\right )}{2 c^3}-\frac {\left (3 a b c e-2 a c^2 d+b^3 (-e)+b^2 c d\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^3 \sqrt {b^2-4 a c}}+\frac {x (c d-b e)}{c^2}+\frac {e x^2}{2 c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.15, antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {800, 634, 618, 206, 628} \[ -\frac {\left (a c e+b^2 (-e)+b c d\right ) \log \left (a+b x+c x^2\right )}{2 c^3}-\frac {\left (3 a b c e-2 a c^2 d+b^2 c d+b^3 (-e)\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^3 \sqrt {b^2-4 a c}}+\frac {x (c d-b e)}{c^2}+\frac {e x^2}{2 c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 628
Rule 634
Rule 800
Rubi steps
\begin {align*} \int \frac {x^2 (d+e x)}{a+b x+c x^2} \, dx &=\int \left (\frac {c d-b e}{c^2}+\frac {e x}{c}-\frac {a (c d-b e)+\left (b c d-b^2 e+a c e\right ) x}{c^2 \left (a+b x+c x^2\right )}\right ) \, dx\\ &=\frac {(c d-b e) x}{c^2}+\frac {e x^2}{2 c}-\frac {\int \frac {a (c d-b e)+\left (b c d-b^2 e+a c e\right ) x}{a+b x+c x^2} \, dx}{c^2}\\ &=\frac {(c d-b e) x}{c^2}+\frac {e x^2}{2 c}-\frac {\left (b c d-b^2 e+a c e\right ) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 c^3}+\frac {\left (b^2 c d-2 a c^2 d-b^3 e+3 a b c e\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 c^3}\\ &=\frac {(c d-b e) x}{c^2}+\frac {e x^2}{2 c}-\frac {\left (b c d-b^2 e+a c e\right ) \log \left (a+b x+c x^2\right )}{2 c^3}-\frac {\left (b^2 c d-2 a c^2 d-b^3 e+3 a b c e\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c^3}\\ &=\frac {(c d-b e) x}{c^2}+\frac {e x^2}{2 c}-\frac {\left (b^2 c d-2 a c^2 d-b^3 e+3 a b c e\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^3 \sqrt {b^2-4 a c}}-\frac {\left (b c d-b^2 e+a c e\right ) \log \left (a+b x+c x^2\right )}{2 c^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.08, size = 119, normalized size = 0.98 \[ \frac {\left (-a c e+b^2 e-b c d\right ) \log (a+x (b+c x))+\frac {2 \left (3 a b c e-2 a c^2 d+b^3 (-e)+b^2 c d\right ) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {4 a c-b^2}}\right )}{\sqrt {4 a c-b^2}}+2 c x (c d-b e)+c^2 e x^2}{2 c^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.15, size = 414, normalized size = 3.42 \[ \left [\frac {{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e x^{2} + \sqrt {b^{2} - 4 \, a c} {\left ({\left (b^{2} c - 2 \, a c^{2}\right )} d - {\left (b^{3} - 3 \, a b c\right )} e\right )} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c - \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + 2 \, {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d - {\left (b^{3} c - 4 \, a b c^{2}\right )} e\right )} x - {\left ({\left (b^{3} c - 4 \, a b c^{2}\right )} d - {\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )}}, \frac {{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e x^{2} - 2 \, \sqrt {-b^{2} + 4 \, a c} {\left ({\left (b^{2} c - 2 \, a c^{2}\right )} d - {\left (b^{3} - 3 \, a b c\right )} e\right )} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 2 \, {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d - {\left (b^{3} c - 4 \, a b c^{2}\right )} e\right )} x - {\left ({\left (b^{3} c - 4 \, a b c^{2}\right )} d - {\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.17, size = 122, normalized size = 1.01 \[ \frac {c x^{2} e + 2 \, c d x - 2 \, b x e}{2 \, c^{2}} - \frac {{\left (b c d - b^{2} e + a c e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{3}} + \frac {{\left (b^{2} c d - 2 \, a c^{2} d - b^{3} e + 3 \, a b c e\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.04, size = 241, normalized size = 1.99 \[ \frac {3 a b e \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c^{2}}-\frac {2 a d \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c}-\frac {b^{3} e \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c^{3}}+\frac {b^{2} d \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c^{2}}+\frac {e \,x^{2}}{2 c}-\frac {a e \ln \left (c \,x^{2}+b x +a \right )}{2 c^{2}}+\frac {b^{2} e \ln \left (c \,x^{2}+b x +a \right )}{2 c^{3}}-\frac {b d \ln \left (c \,x^{2}+b x +a \right )}{2 c^{2}}-\frac {b e x}{c^{2}}+\frac {d x}{c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.17, size = 168, normalized size = 1.39 \[ x\,\left (\frac {d}{c}-\frac {b\,e}{c^2}\right )-\frac {\ln \left (c\,x^2+b\,x+a\right )\,\left (4\,e\,a^2\,c^2-5\,e\,a\,b^2\,c+4\,d\,a\,b\,c^2+e\,b^4-d\,b^3\,c\right )}{2\,\left (4\,a\,c^4-b^2\,c^3\right )}+\frac {e\,x^2}{2\,c}-\frac {\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )\,\left (e\,b^3-d\,b^2\,c-3\,a\,e\,b\,c+2\,a\,d\,c^2\right )}{c^3\,\sqrt {4\,a\,c-b^2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 2.04, size = 609, normalized size = 5.03 \[ x \left (- \frac {b e}{c^{2}} + \frac {d}{c}\right ) + \left (- \frac {\sqrt {- 4 a c + b^{2}} \left (3 a b c e - 2 a c^{2} d - b^{3} e + b^{2} c d\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {a c e - b^{2} e + b c d}{2 c^{3}}\right ) \log {\left (x + \frac {2 a^{2} c e - a b^{2} e + a b c d + 4 a c^{3} \left (- \frac {\sqrt {- 4 a c + b^{2}} \left (3 a b c e - 2 a c^{2} d - b^{3} e + b^{2} c d\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {a c e - b^{2} e + b c d}{2 c^{3}}\right ) - b^{2} c^{2} \left (- \frac {\sqrt {- 4 a c + b^{2}} \left (3 a b c e - 2 a c^{2} d - b^{3} e + b^{2} c d\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {a c e - b^{2} e + b c d}{2 c^{3}}\right )}{3 a b c e - 2 a c^{2} d - b^{3} e + b^{2} c d} \right )} + \left (\frac {\sqrt {- 4 a c + b^{2}} \left (3 a b c e - 2 a c^{2} d - b^{3} e + b^{2} c d\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {a c e - b^{2} e + b c d}{2 c^{3}}\right ) \log {\left (x + \frac {2 a^{2} c e - a b^{2} e + a b c d + 4 a c^{3} \left (\frac {\sqrt {- 4 a c + b^{2}} \left (3 a b c e - 2 a c^{2} d - b^{3} e + b^{2} c d\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {a c e - b^{2} e + b c d}{2 c^{3}}\right ) - b^{2} c^{2} \left (\frac {\sqrt {- 4 a c + b^{2}} \left (3 a b c e - 2 a c^{2} d - b^{3} e + b^{2} c d\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {a c e - b^{2} e + b c d}{2 c^{3}}\right )}{3 a b c e - 2 a c^{2} d - b^{3} e + b^{2} c d} \right )} + \frac {e x^{2}}{2 c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________